<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>用户反馈 - AI故事生成器</title>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css">
    <link rel="stylesheet" href='/static/css/1.css'>
    <link rel="stylesheet" href="/static/css/header.css">
    <link rel="stylesheet" href="/static/css/footer.css">
    <script src="/static/js/header.js" defer></script>
    <style>
        .feedback-container {
            max-width: 1200px;
            margin: 40px auto;
            padding: 0 20px;
        }

        .feedback-title {
            text-align: center;
            margin-bottom: 30px;
            color: #333;
            font-size: 28px;
            position: relative;
            padding-bottom: 15px;
        }

        .feedback-title:after {
            content: '';
            position: absolute;
            bottom: 0;
            left: 50%;
            transform: translateX(-50%);
            width: 80px;
            height: 3px;
            background: linear-gradient(to right, #6e8efb, #a777e3);
        }

        .feedback-list {
            background: white;
            border-radius: 8px;
            box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
            padding: 20px;
            margin-bottom: 30px;
        }

        .feedback-item {
            border-bottom: 1px solid #eee;
            padding: 15px 0;
        }

        .feedback-item:last-child {
            border-bottom: none;
        }

        .feedback-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 10px;
        }

        .feedback-user {
            font-weight: bold;
            color: #444;
        }

        .feedback-date {
            color: #888;
            font-size: 14px;
        }

        .feedback-content {
            color: #555;
            line-height: 1.6;
            margin-bottom: 8px;
        }

        .feedback-email {
            color: #6e8efb;
            font-size: 14px;
        }

        .no-feedback {
            text-align: center;
            padding: 40px 0;
            color: #888;
        }

        /* 分页器样式 */
        .pagination {
            display: flex;
            justify-content: center;
            margin-top: 30px;
            list-style: none;
        }

        .pagination li {
            margin: 0 5px;
        }

        .pagination a {
            display: block;
            padding: 8px 15px;
            border: 1px solid #ddd;
            border-radius: 4px;
            color: #6e8efb;
            text-decoration: none;
            transition: all 0.3s;
        }

        .pagination a:hover {
            background-color: #f5f7fa;
        }

        .pagination .active a {
            background-color: #6e8efb;
            color: white;
            border-color: #6e8efb;
        }

        .pagination .disabled a {
            color: #ccc;
            cursor: not-allowed;
        }

        .pagination-info {
            text-align: center;
            margin-top: 15px;
            color: #888;
            font-size: 14px;
        }

        @media (max-width: 768px) {
            .feedback-header {
                flex-direction: column;
                align-items: flex-start;
            }

            .feedback-date {
                margin-top: 5px;
            }

            .pagination a {
                padding: 6px 12px;
            }
        }
    </style>
</head>
<body>
<!-- 导航栏 -->
{% include 'header.html' %}

<div class="feedback-container">
    <h1 class="feedback-title">用户反馈</h1>

    <div class="feedback-list">
        {% if feedbacks %}
            {% for feedback in feedbacks %}
                <div class="feedback-item">
                    <div class="feedback-header">
                        <span class="feedback-user">{{ feedback.user }}</span>
                        <span class="feedback-date">{{ feedback.date }}</span>
                    </div>
                    <div class="feedback-content">{{ feedback.content }}</div>
                    <div class="feedback-email">{{ feedback.email }}</div>
                </div>
            {% endfor %}
        {% else %}
            <div class="no-feedback">
                <p>暂无用户反馈</p>
            </div>
        {% endif %}
    </div>

    <!-- 分页器 -->
    {% if feedbacks.has_other_pages %}
        <ul class="pagination">
            {% if feedbacks.has_previous %}
                <li><a href="?page=1">&laquo; 首页</a></li>
                <li><a href="?page={{ feedbacks.previous_page_number }}">上一页</a></li>
            {% else %}
                <li class="disabled"><a href="#">&laquo; 首页</a></li>
                <li class="disabled"><a href="#">上一页</a></li>
            {% endif %}

            {% for i in feedbacks.paginator.page_range %}
                {% if feedbacks.number == i %}
                    <li class="active"><a href="#">{{ i }}</a></li>
                {% else %}
                    <li><a href="?page={{ i }}">{{ i }}</a></li>
                {% endif %}
            {% endfor %}

            {% if feedbacks.has_next %}
                <li><a href="?page={{ feedbacks.next_page_number }}">下一页</a></li>
                <li><a href="?page={{ feedbacks.paginator.num_pages }}">末页 &raquo;</a></li>
            {% else %}
                <li class="disabled"><a href="#">下一页</a></li>
                <li class="disabled"><a href="#">末页 &raquo;</a></li>
            {% endif %}
        </ul>

        <div class="pagination-info">
            第 {{ feedbacks.number }} 页，共 {{ feedbacks.paginator.num_pages }} 页
        </div>
    {% endif %}
</div>

{% include 'footer.html' %}
</body>
</html>